<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>数量值{{ totolnum }}</strong></span>
    <ul class="filters">
      <li>
        <a :class="{selected : getSel === 'all'}" href="javascript:;" @click="$emit('changeType','all')">全部</a>
      </li>
      <li>
        <a :class="{selected : getSel === 'no'}" href="javascript:;" @click="$emit('changeType','no')">未完成</a>
      </li>
      <li>
        <a :class="{selected : getSel === 'yes'}" href="javascript:;" @click="$emit('changeType','yes')">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="clearFn">清除已完成</button>
  </footer>
</template>

<script>
// 1 通过点击按钮把all,yes,no传给getSel
export default {
   props:{
    getSel: String ,// 2传getSel来判断动态添加类名
    totolnum: Number
   },
   data() {
    return {
      num : ''
    }
   },
   methods:{
    clearFn(){
      this.$emit('clearTask','yes')
    }
   }
}
</script>